<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>AngularJS路由使用 </title>
		<script type="text/javascript" src="../js/angular.min.js" ></script>
		<script type="text/javascript" src="../js/angular-route.min.js" ></script>
	</head>
	<body >
		<div ng-app="myapp">
		
			<div>
				<h1>HEAD</h1>
				<a href="#/JavaEE1">JavaEE</a>
				<a href="#/IOS1">IOS</a>
				<a href="#/Android1">Android</a>
			</div>
			<!-- 路由加载后，更新变化的内容 -->
			<div ng-view>
				
			</div>
			<div>
				<h1>FOOT</h1>
			</div>
		
		</div>
	</body>
	<script type="text/javascript">
		// 定义 myapp 模块 
		var myapp = angular.module("myapp",["ngRoute"]);
		
		// 配置模块的路由 
		myapp.config(["$routeProvider", function(abc){
			abc
			 .when('/JavaEE1', {
				 templateUrl: '5_1.html'
			 }).when('/IOS1', {
				 templateUrl: '5_2.html'
			 }).when('/Android1', {
				 templateUrl: '5_3.html'
			 }).otherwise({
			 	redirectTo: '/JavaEE1'
			 });
		}]);
		
	</script>
</html>
